define([], function() {
    var tpl = {};

    tpl.stage = function() {
        return stage();
    }
    tpl.stageForm = function() {
        return stageForm();
    }
    tpl.stageCourse = function() {
        return stageCourse();
    }
    tpl.schemeClassAll = function() {
        return schemeClassAll();
    }
    tpl.queryAllCourse = function() {
        return queryAllCourse();
    }
    tpl.addCourse = function() {
        return addCourse();
    }
    var stage = function() {
        return  '<script id="programEdit_stage" type="text/html">' +
                '   {{if list.length>0}}' +
                '       <div id="btns" class="stage-btnBox clearfix">' +
                '           <div>' +
                '               <div id="upStage"><i class="fa fa-arrow-left" aria-hidden="true"></i>前移</div>' +
                '               <div id="downStage"><i class="fa fa-arrow-right" aria-hidden="true"></i>后移</div>' +
                '           </div>' +
                '           <div>' +
                '               <div id="modifyStage"><i class="fa fa-pencil-square-o" aria-hidden="true"></i>编辑</div>' +
                '               <div id="delStage"><i class="fa fa-trash-o" aria-hidden="true"></i>删除</div>' +
                '           </div>' +
                '           <div>' +
                '               <div id="addStage"><i class="fa fa-plus-circle" aria-hidden="true"></i>添加</div>' +
                '           </div>' +
                '       </div>' +
                '       <div class="stage-listBox">' +
                '           <div id="stageList" class="clearfix">' +
                '               {{each list as value i}}' +
                '                   <div class="program" id="{{value.id}}" data-seqNo="{{value.seqNo}}">{{value.stageName}}</div>' +
                '               {{/each}}' +
                '           </div>' +
                '       </div>' +
                '   {{else}}' +
                '       <div class="stage-null">' +
                '           还没有阶段，请点击<span id="addStage">添加阶段</span>' +
                '       </div>' +
                '   {{/if}}' +
                '</script>';
    }
    var stageForm = function() {
        return  '<script id="programEdit_stageForm" type="text/html">' +
                '	<div>' +
                '	    <div class="form-group">' +
                '	        <input id="stageName" type="text" class="form-control" value="{{stageName}}">' +
                '	    </div>' +
                '		<div id="{{if stageName}}modify{{else}}add{{/if}}" class="confirmBtn">确定</div>' +
                '   </div>' +
                '</script>';
    }
    var stageCourse = function() {
        return  '<script id="programEdit_stageCourse" type="text/html">' +
                '   {{if list.length>0}}' +
                '       {{each list as value i}}' +
                '           <div class="course-list clearfix" id="{{value.id}}" data-seqNo="{{value.seqNo}}">' +
                '               <div class="course-list-index">{{value.seqNo}}</div>' +
                '               <div class="course-list-course">{{value.courseName}}</div>' +
                '               <div class="btns">' +
                '                   <div class="course-list-upBtn"><i class="fa fa-arrow-up" aria-hidden="true"></i></div>' +
                '                   <div class="course-list-downBtn"><i class="fa fa-arrow-down" aria-hidden="true"></i></div>' +
                '                   <div class="course-list-delBtn"><i class="fa fa-trash-o" aria-hidden="true"></i></div>' +
                '               </div>' +
                '           </div>' +
                '       {{/each}}' +
                '   {{/if}}' +
                '</script>';
    }
    var schemeClassAll = function() {
        return  '<script id="programEdit_schemeClassAll" type="text/html">' +
                '   {{each list as value i}}' +
                '       <option value="{{value.id}}">{{value.class_name}}</option>' +
                '   {{/each}}' +
                '</script>';
    }
    var queryAllCourse = function() {
        return  '<script id="programEdit_queryAllCourse" type="text/html">' +
                '   {{if list.length>0}}' +
                '       {{each list as value i}}' +
                '           <div class="course-list clearfix" id="{{value.id}}" data-version="{{value.course_version}}">' +
                '               <div class="course-list-index">{{i+1}}</div>' +
                '               <div class="course-list-course">{{value.course_name}}</div>' +
                '               <div class="btns">' +
                '                   <div class="course-list-editBtn"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></div>' +
                '               </div>' +
                '           </div>' +
                '       {{/each}}' +
                '   {{/if}}' +
                '</script>';
    }
    var addCourse = function() {
        return  '<script id="programEdit_addCourse" type="text/html">' +
                '   <div class="programEdit-modal">' +
                '       <div class="form-horizontal clearfix">'+
                '          <div class="form-group col-sm-12 col-md-12">'+
                '              <label class="control-label"><i class="no-null">*</i>疗程名称</label>'+
                '              <div class="control-input">'+
                '                  <input type="text" class="form-control" id="tpl_courseName" placeholder="请输入疗程名称">'+
                '              </div>'+
                '          </div>'+
                '          <div class="form-group col-sm-12 col-md-12">'+
                '              <label class="control-label"><i class="no-null">*</i>方案分类</label>'+
                '              <div class="control-input">'+
                '                  <select class="form-control" id="tpl_classId">' +
                '                       {{each schemeClass as value i}}' +
                '                           <option value="{{value.id}}">{{value.class_name}}</option>' +
                '                       {{/each}}' +
                '                  </select>' +
                '              </div>'+
                '          </div>'+
                '          <div class="form-group col-sm-12 col-md-12">'+
                '              <label class="control-label"><i class="no-null">*</i>分组情况</label>'+
                '              <div class="control-input">'+
                '                  <select class="form-control" id="tpl_group">' +
                '                      <option value="00">不随机</option>' +
                '                      <option value="01">随机A组</option>' +
                '                      <option value="02">随机B组</option>' +
                '                      <option value="03">随机D组</option>' +
                '                      <option value="04">随机I组</option>' +
                '                  </select>' +
                '              </div>'+
                '          </div>'+
                '          <div class="form-group col-sm-12 col-md-12">'+
                '              <label class="control-label"><i class="no-null">*</i>疗程类型</label>'+
                '              <div class="control-input">'+
                '                  <select class="form-control" id="tpl_courseType">' +
                '                      <option value="00">正常疗程</option>' +
                '                      <option value="01">额外疗程</option>' +
                '                  </select>' +
                '              </div>'+
                '          </div>'+
                 '          <div class="form-group col-sm-12 col-md-12">'+
                '              <label class="control-label">备注</label>'+
                '              <div class="control-input">'+
                '                  <textarea id="tpl_courseIntro" class="form-control" placeholder="请输入疗程说明"></textarea>' +
                '              </div>'+
                '          </div>'+
                '       </div>'+
                '       <div class="editMedicBtn" id="add">添加</div>' +
                '   </div>' +
                '</script>';
    }

    return tpl;
});